/*
 * @Author: 邱狮杰
 * @Date: 2021-07-09 23:18:58
 * @LastEditTime: 2021-07-09 23:40:34
 * @FilePath: /professional-work-decorator/src/property/min.ts
 * @Description: min
 */
import "reflect-metadata";
// const min = Symbol("min");
export function Min<T>(val: T): PropertyDecorator {
  return function (target: Object, key: string | symbol) {
    Reflect.defineMetadata(key, val, target);
  };
}
function verificationMinMethodDecorator(property: string): MethodDecorator {
  return function (
    target: Object,
    key: string | symbol,
    desc: TypedPropertyDescriptor<any>
  ) {
    console.log(Reflect.getMetadata(property, target).name, "what?");
    return desc;
  };
}
class A {
  @Min(1)
  b: number | undefined;
  @verificationMinMethodDecorator("b")
  verifyB() {}
}
